<div class="pa clearfix">
  <div class="span-p70 colborder">
    <h3>产品列表</h3>
    <hr/>
    <div>
      <table>
        <tr>
          <th>Id</th>
          <th>名称</th>
          <th>分类</th>
          <th>价格</th>
          <th>折扣</th>
          <th>库存</th>
          <th>操作</th>
        </tr>
        <% @products.each do |product| %>
        <tr>
          <td><%= product.id %></td>
          <td><%= link_to product.name, "/products/show/#{product.id}", :target => '_blank' %></td>
          <td><%= product.type.name %></td>
          <td><%= product.price %>元</td>
          <td><%= product.discount %>折</td>
          <td><%= product.stock %>份</td>
          <td>
            <%= link_to '编辑', "/products/edit/#{product.id}" %> |
            <%= link_to '删除', "/products/delete/#{product.id}", :confirm => '你确认要删除吗？' %>
          </td>
        </tr>
        <% end %>
      </table>
      <div class="c666">
        <%= will_paginate @products %>
      </div>
    </div>
  </div>
  <div class="span-5 last">
    <%= render 'layouts/admin/products_sidebar' %>
  </div>
</div>